home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / batcher.zip / INP-TEST.BAT < prev    next >
DOS Batch File  |  1986-07-13  |  1KB  |  48 lines

  1. ECHO OFF
  2. .This demonstrates the INPUT program
  3. .Use ECHO statements to create a menu, then branch on the keyin
  4. CLS
  5. ECHO   EXAMPLE OF AN INPUT.COM MENU
  6. ECHO ===================================
  7. ECHO To do the first thing, press --  A
  8. ECHO To do the second thing, press -- B
  9. ECHO To do the third thing, press --  3
  10. ECHO To do the fourth thing, press -- D
  11. ECHO To do the fifth thing, press --  E
  12. ECHO ===================================
  13. .Notice that the input can be any printable key (but forced to upper case)
  14. INPUT "AB3DE"
  15. .Note that the IF ERRORLEVEL checks for error or HIGHER,so you must test
  16. .in reverse order (high first) -- ESC always returns a 255 value
  17. IF ERRORLEVEL 255 GOTO ESC
  18. IF ERRORLEVEL 5 GOTO FIVE
  19. IF ERRORLEVEL 4 GOTO FOUR
  20. IF ERRORLEVEL 3 GOTO THREE
  21. IF ERRORLEVEL 2 GOTO TWO
  22. IF ERRORLEVEL 1 GOTO ONE
  23. :ESC
  24. ECHO You pressed the ESC key
  25. GOTO STOP
  26. :ONE
  27. ECHO You pressed the A key
  28. .User can run a program here
  29. GOTO STOP
  30. :TWO
  31. ECHO You pressed the B key
  32. .User can run a program here
  33. GOTO STOP
  34. :THREE
  35. ECHO You pressed the 3 key
  36. .User can run a program here
  37. GOTO STOP
  38. :FOUR
  39. ECHO You pressed the D key
  40. .User can run a program here
  41. GOTO STOP
  42. :FIVE
  43. ECHO You pressed the E key
  44. .User can run a program here
  45. GOTO STOP
  46. :STOP
  47. .Here, you can start another batch file with a different menu
  48. ECHO ON